<!DOCTYPE html>
<html lang="en">
<head>
	<title>Editor Test</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

	<script type="text/javascript" src="../boilerplate.js"></script>

	<script type="text/javascript">
		require([
			"doh/runner",
			"dojo/parser",
			"dijit/registry",
			"dijit/Editor",
			"dojo/domReady!"
		], function(doh, parser, registry){
			 
			doh.register("parse", function(){
				parser.parse();
			});

			doh.register("test value", [
				{
					name: "test value",
					timeout: 10000,
					runTest: function(){
						var d = new doh.Deferred();

						
						setTimeout(d.getTestCallback(function(){
							var value = registry.byId('editor').get('value');
							doh.is("日本語", value );
							
							registry.byId('editor').set('value', 'こんにちは');
							value = registry.byId('editor').get('value');
							doh.is("こんにちは", value );
							
							registry.byId('editor').set('value', '日本語');
						}), 2000);

						return d;
					}
				}
			]);

			doh.run();
		});
	</script>
</head>
<body class="claro" role="main">
<script type="dojo/require">
	registry: "dijit/registry"
</script>
<form method="get">
<p>
Plain text: 日本語
</p>

<p>
Same text should show up in the Editor:
</p>
<div id="editor" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor",name:"field"'>日本語</div>
<input type="submit" value="Save" />
<button type=button onclick="console.log(registry.byId('editor').get('value'))">getValue</button>
<button type=button onclick="registry.byId('editor').set('value', 'こんにちは')">set value to こんにちは</button>

</form>
</body>
</html>
